<ul class="goods__list__inner">
    <?php foreach ($models as $model): ?>
        <li class="goods__list__item">
            <div class="goods-item">
                <ul class="goods-item__info">
                    <li class="goods-item__info__item name">
                        <div class="global-photo">
                            <a href="/<?php echo $model['prod_url']; ?>">
                                <img src="<?php
                                        $src = file_exists(Yii::app()->basePath . '/../images/products/' . $model['prod_image']) ? Yii::app()->request->baseUrl . '/images/products/' . $model['prod_image'] : Yii::app()->request->baseUrl . '/images/articles/no_photo.jpg';
                                        echo $src;
                                        ?>" alt="<?php echo $model['prod_title']; ?>" />
                            </a>
                        </div>
                        <div class="name__description">
                            <h2>
                                <a href="/<?php echo $model['prod_url']; ?>"><?php echo $model['prod_title']; ?></a>
                            </h2>
                        </div>
                    </li>
                    <?php foreach ($prices as $key => $price): ?>
                        <?php
                        if (Yii::app()->user->isGuest) {
                            if ($key == 0)
                                $oPrice = $model['price_' . $price['price_fname']];
                        } else {
                            $oPrice = $model['price_' . Yii::app()->user->price];
                        }
                        ?>
                        <li class="goods-item__info__item">
                            <ul class="<?php echo $key == 0 ? 'retail-price__list' : 'price-wholesale__list'; ?>">
                                <li><?php echo $price['price_title']; ?>:</li>
                                <li><?php echo number_format($model['price_' . $price['price_fname']], 0, '.', ' '); ?> <span class="goods__list__ruble">c</span></li>
                            </ul>
                        </li>
                    <?php endforeach; ?>
                    <?php
                    if ($model['prod_count'] <= 33)
                        $contClass = 'little';
                    elseif ($model['prod_count'] <= 66)
                        $contClass = 'average';
                    else
                        $contClass = 'lot';
                    $calc = $model['prod_count'] > 100 ? 100 : $model['prod_count'];
                    ?>   
                    <li class="goods-item__info__item availability">
                        <ul class="availability__list">
                            <li>Наличие:</li>
                            <li>
                                <div data-count="<?php echo $model['prod_count']; ?>" class="availability__indicator <?php echo $contClass; ?>">
                                    <div class="availability__indicator__inner" style="width: <?php echo $calc ?>%;">&nbsp;</div>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <li class="goods-item__info__item number">
                        <ul class="number__list">
                            <li>
                                <div class="number__counter">
                                    <div class="number__counter__fewer">
                                        <span>-</span>
                                    </div>
                                    <div class="number__counter__result">
                                        <input data-t="<?php echo (int) $model['prod_count']; ?>" type="text" value="1" />
                                    </div>
                                    <div class="number__counter__more">
                                        <span>+</span>
                                    </div>
                                </div>  
                            </li>
                            <li>
                                <a href="#" data-t="<?php echo (int) $model['prod_count']; ?>" data-id="<?php echo $model['prod_id']; ?>" data-image="<?php echo $model['prod_image']; ?>" data-url="<?php echo $model['prod_url']; ?>" data-price="<?php echo (int) $oPrice; ?>" data-title="<?php echo $model['prod_title']; ?>" class="green-button">Купить</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>  
        </li> 
    <?php endforeach; ?>
</ul> 